remove from a txt everything between '[' and '] ' (included '[' and'] ')

from:
[FOOooOoOOO] this is ok1
[FOOooOOO] this is ok2

to:
this is ok1
this is ok2


tnx! :)
slystoner [ Do, 03 April 2008 17:00 ] [ ID #1934448 ]

Re: remove from a txt everything between '[' and '] ' (included '['

On Apr 3, 8:00 pm, slystoner <slysto... [at] gmail.com> wrote:
> from:
> [FOOooOoOOO] this is ok1
> [FOOooOOO] this is ok2
>
> to:
> this is ok1
> this is ok2
>
> tnx! :)

echo '[FOOooOoOOO]' | sed 's/\[[^]]\+\]//'
Jeenu [ Do, 03 April 2008 17:42 ] [ ID #1934450 ]

Re: remove from a txt everything between '[' and '] ' (included '[' and '] ')

Jeenu ha scritto:
> On Apr 3, 8:00 pm, slystoner <slysto... [at] gmail.com> wrote:
>> from:
>> [FOOooOoOOO] this is ok1
>> [FOOooOOO] this is ok2
>>
>> to:
>> this is ok1
>> this is ok2
>>
>> tnx! :)
>
> echo '[FOOooOoOOO]' | sed 's/\[[^]]\+\]//'

perfect,tank you!

a question: what's the best way to learn the syntax? do you know a good
manual or site? (well, a good introduction in my case... eheh!)
slystoner [ Do, 03 April 2008 18:04 ] [ ID #1934452 ]

Re: remove from a txt everything between '[' and '] ' (included '['

On Apr 3, 9:04 pm, slystoner <slysto... [at] gmail.com> wrote:
> Jeenu ha scritto:
>
> > On Apr 3, 8:00 pm, slystoner <slysto... [at] gmail.com> wrote:
> >> from:
> >> [FOOooOoOOO] this is ok1
> >> [FOOooOOO] this is ok2
>
> >> to:
> >> this is ok1
> >> this is ok2
>
> >> tnx! :)
>
> > echo '[FOOooOoOOO]' | sed 's/\[[^]]\+\]//'
>
> perfect,tank you!
>
> a question: what's the best way to learn the syntax? do you know a good
> manual or site? (well, a good introduction in my case... eheh!)

The core part is to learn Basic regular expressions (BRE), for which
there would be plenty of tutorials out there. Rest, it's all similar,
be it grep, sed or awk. http://www.regular-expressions.info/ could be
a good starting point. Equally good are the manuals for above
mentioned programs.
Jeenu [ Do, 03 April 2008 18:30 ] [ ID #1934458 ]
Linux » comp.unix.shell » remove from a txt everything between '[' and '] ' (included '[' and'] ')

Vorheriges Thema: filter and then pipe a file back to itself
Nächstes Thema: Reading binary float data as string